﻿//-------------------------------------------------------------------------------------------------
// <copyright file="IQuoteService.cs" company="Andrew Craig Keller">
//  Copyright (c) Andrew Craig Keller.  All rights reserved.
// </copyright>
//-------------------------------------------------------------------------------------------------

namespace StockQuoteServices
{
    using System;
    using System.Collections.Generic;
    using System.ServiceModel;
    using StockQuoteServices.Contracts;

    /// <summary>
    /// Provides functionality for retrieving stock information, quotes, and historical prices.
    /// </summary>
    [ServiceContract(      
        Namespace = "contracts.stockquote.wayne.keller-pa.net",
        Name="QuoteService")]
    public interface IQuoteService
    {
        /// <summary>
        /// Gets basic data and the last traded price for the stock with the given ticker symbol.
        /// </summary>
        /// <param name="tickerSymbol">
        /// the ticker symbol of the stock for which data is to be retrieved
        /// </param>
        /// <returns>
        /// a <see cref="Stock"/> object populated with basic information and the last price at
        /// which the stock was traded
        /// </returns>
        [OperationContract]
        Stock GetStock(string tickerSymbol);

        /// <summary>
        /// Gets basic data, the last traded price, and historical price data for the given date
        /// range for the stock with the given ticker symbol.
        /// </summary>
        /// <param name="tickerSymbol">
        /// the ticker symbol of the stock for which data is to be retrieved
        /// </param>
        /// <param name="priceRangeStart">
        /// the starting date of the period for which historical price data is to be retrieved
        /// </param>
        /// <param name="priceRangeEnd">
        /// the ending date of the period for which historical price data is to be retrieved
        /// </param>
        /// <returns>
        /// a <see cref="Stock"/> object populated with basic information, the last price at which
        /// the stock was traded, and historical prices for the given date range
        /// </returns>
        [OperationContract]
        Stock GetStockWithPriceHistory(
            string tickerSymbol,
            DateTime priceRangeStart,
            DateTime priceRangeEnd);

        /// <summary>
        /// Gets historical price data for the given date range for the stock with the given ticker
        /// symbol.
        /// </summary>
        /// <param name="tickerSymbol">
        /// The ticker symbol of the stock for which data is to be retrieved
        /// </param>
        /// <param name="priceRangeStart">
        /// the starting date of the period for which historical price data is to be retrieved
        /// </param>
        /// <param name="priceRangeEnd">
        /// the ending date of the period for which historical price data is to be retrieved
        /// </param>
        /// <returns>
        /// an <see cref="IList{T}"/> of <see cref="StockHistoricalPrice"/> objects for the
        /// given date range
        /// </returns>
        [OperationContract]
        IList<StockHistoricalPrice> GetHistoricalPrices(
            string tickerSymbol,
            DateTime priceRangeStart,
            DateTime priceRangeEnd);
    }
}
